<?php

namespace app\silk_eshop\controller;

/**
 * MyFavoriteController 类
 *
 * @since VER:1.0; DATE:2016-9-1; AUTHOR:SoChishun; EMAIL:14507247@qq.com; DESC:Added.
 */
class MyFavoriteController extends AppbaseMyController {

    function index() {
        $m_fav = new \XWAM\Model\ProductFavoriteModel();
        $list = $m_fav->get_favorite_paging_list($page, array('f.user_name' => $this->user_login_data['user_name']));
        $this->assign('list', $list);
        $this->assign('pager', $page->show());
        $this->display();
    }

    function delete_favorite($id = 0) {
        if ($id) {
            $m_fav = new \XWAM\Model\ProductFavoriteModel();
            $m_fav->delete($id);
        }
    }

}
